package com.jxd.reportsys.service.impl;

import com.jxd.reportsys.dao.IUserMapper;
import com.jxd.reportsys.model.User;
import com.jxd.reportsys.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author 朱隶文
 * @Date 2024/9/19 16:47
 * @Version 1.0
 */
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserMapper userMapper;

    @Override
    public int login(String uname, String pwd) {
        int empno = 0;
        User user = userMapper.login(uname, pwd);
        if(user != null) {
            empno = user.getEmpno();
        }
        return empno;
    }

    @Override
    public boolean editPwd(int empno, String pwd) {
        return userMapper.editPwd(empno, pwd);
    }
}
